
const arr: (number | string)[] = []

// 类型别名
type Name = number | string

const arr1: Name[] = []

type Person = {
    name: string,
    age: number
}

interface IPerson {
    name: string,
    age: number
}


// 3. 字面量类型  类似于枚举
type Gender = 'male' | 'female' | 'X'
type Grade = 1 | 2 | 3 | 4 //几年级

interface IPerson1 {
    name: string;
    age: number;
    gender: Gender;
    grade: 1 | 2 | 3 | 4
}

let p1: IPerson1 = {
    name: "jack",
    age: 20,
    gender: "X",
    grade: 1
}

export default null